package de.axone.wash.handler;

import javax.servlet.http.HttpServletRequest;

import de.axone.wash.Wash;
import de.axone.wash.configuration.Configuration;


public interface Handler {
	
	public static class HandlerException extends Exception{
		
		public HandlerException(){ super(); }
		public HandlerException( String message ) { super( message ); }
		public HandlerException( String message, Throwable cause ) { super( message, cause ); }
		public HandlerException( Throwable cause ) { super( cause ); }
	}
	public static class ServiceNotFoundException extends HandlerException{
		
		public ServiceNotFoundException(){ super(); }
		public ServiceNotFoundException( String message ) { super( message ); }
		public ServiceNotFoundException( String message, Throwable cause ) { super( message, cause ); }
		public ServiceNotFoundException( Throwable cause ) { super( cause ); }
	}
	public static class OperationNotFoundException extends HandlerException{
		
		public OperationNotFoundException(){ super(); }
		public OperationNotFoundException( String message ) { super( message ); }
		public OperationNotFoundException( String message, Throwable cause ) { super( message, cause ); }
		public OperationNotFoundException( Throwable cause ) { super( cause ); }
	}
	public static class WrongParametersException extends HandlerException{
		
		public WrongParametersException(){ super(); }
		public WrongParametersException( String message ) { super( message ); }
		public WrongParametersException( String message, Throwable cause ) { super( message, cause ); }
		public WrongParametersException( Throwable cause ) { super( cause ); }
	}
	public static class ServiceError extends HandlerException{
		
		public ServiceError( String message ) { super( message ); }
		public ServiceError( String message, Throwable cause ) { super( message, cause ); }
		public ServiceError( Throwable cause ) { super( cause ); }
	}
	
	public void init( Configuration config ) throws HandlerException;
	
	public Wash handle( Wash request, HttpServletRequest httpRequest ) throws HandlerException;
}
